package com.dingding.special.order.appoint.biz.special.tcppush;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dingding.common.core.beans.Userdetail;
import com.dingding.common.core.beans.special.UserspecialorderT;
import com.dingding.common.core.push.enums.push.SpecialDriverPushEnum;
import com.dingding.common.core.push.factory.dtos.OrderDurationDTO;
import com.dingding.common.core.push.factory.request.IPushRequestFactory;
import com.dingding.facade.queue.facade.IQueueFacade;
import com.dingding.special.order.appoint.biz.special.AppointRealOrderServiceImpl;
import com.dingding.special.user.driver.dto.onlinedriver.OLineDriverDto;

/**
 * @Description 专车指派实时订单，改写为TCP推送
 * @author fengshuonan
 * @date 2016年12月1日 上午11:44:59
 */
@Component("tcpAppointRealOrder")
public class TcpAppointRealOrder extends AppointRealOrderServiceImpl{
	
	@Resource(name = "specialDriverPushRequestFactory")
	private IPushRequestFactory specialDriverPushRequestFactory;
	
	@Resource(name = "queueFacade")
	private IQueueFacade queueFacade;
	
	@Override
	protected void pushDriverOrder(UserspecialorderT userspecialorderT, OLineDriverDto dto, Userdetail userdetail,
			OrderDurationDTO orderDurationDTO) {
		String pushBean = this.specialDriverPushRequestFactory.createPushRequestString(
				SpecialDriverPushEnum.TcpAppointSpecialOrderPush.toString(),
				dto.getUserId(),userdetail, userspecialorderT,orderDurationDTO);
		this.queueFacade.addNettyPushToQueue(pushBean);
	}
}
